<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp" %>

<head>
    <title>New Transactions</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <link rel="stylesheet" href="<c:url value="/css/styles.css"/>"/>
    <script src="<c:url value="/javascripts/common.js"/>" type="text/javascript"></script>

    <link rel="stylesheet"
          href="<c:url value="/javascripts/jscalendar/theme/calendar-system.css"/>"/>
    <script src="<c:url value="/javascripts/jscalendar/calendar-cfg.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/calendar.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/jscalendar/lang/calendar-en.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/jscalendar/calendar-setup.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/jquery-1.4.4.js"/>" type="text/javascript"></script>
</head>

<body>
<div class="page">
    <%@include file="../../top_menu.jsp" %>
    <table width=100%>
    <tr>
    	<td><c:import url="/WEB-INF/jsp/menu/admin_transaction_menu.jsp" /></td>
    </tr>
    <tr>
    	<td><h3>Search transactions:</h3></td>
    </tr>
    <tr>
       	<td>
       		<form:form method="post" action="search.htm" commandName="transactionsSearch">
				<table border=0 cellpadding=0 cellspacing=0 width="80%" class="formTable">
					<tr>
						<td colspan="7" class="formHeader">
							Search
						</td>
					</tr>
					<tr>
						<td><b>Service Provider</b></td>
						<td>SSN:</td>
						<td><form:input path="providerSSN"/></td>
						<td>First Name:</td>
						<td> <form:input path="providerFirstName"/> </td>
						<td>Last Name:</td>
						<td> <form:input path="providerLastName"/></td>
					</tr>
					
					<tr>
						<td><b>Other</b></td>
						<td>Transaction ID:</td>
						<td><form:input path="transactionId"/></td>
						<td>Status:</td>
						<td> 
							<form:select path="selectedTransactionStatus">
									<form:options items="${transactionsSearch.transactionStatus}"/>
							</form:select>
						</td>
						<td>Transaction Trace Number:</td>
						<td><form:input path="transactionTraceNumber"/></td>
					</tr>
					<tr>
						<td align="right"> <input class="ui-button ui-state-default ui-corner-all" type="submit" name="Search"/> </td>
					</tr>
				</table>
			</form:form>
		</td>
   	</tr>
    <tr>
        <td>
            <%@include file="/WEB-INF/jsp/include/messages.jsp" %> <br/>
        </td>
    </tr>
    </table>
    <c:if test="${!empty searchedTransactions.transactionDetails}">
    <div class="contentArea">
    	<form:form id="main" commandName="searchedTransactions" method="POST" action="processTransactions.htm">
    		<table  border=0 cellpadding=4 cellspacing=1 width=100% bgcolor="#D7D7D7">
    			<tr bgcolor="#FAFAF7">
    				<td align="center" style="font-weight: bold;">Transaction ID</td>
    				<td align="center" style="font-weight: bold;">Trace Number</td>
    				<td align="center" style="font-weight: bold;">Provider</td>
    				<td align="center" style="font-weight: bold;">Customer SSN</td>
    				<td align="center" style="font-weight: bold;">Amount</td>
    				<td align="center" style="font-weight: bold;">Select <a href="#" onclick="ch_select(true);">All</a>
                                /<a href="#" onclick="ch_select(false);">None</a>
                    </td>
    			</tr>
    			<c:forEach var="transaction" items="${searchedTransactions.transactionDetails}">
    				<tr bgcolor="#FFFFFF" >
    					<td align="left">${transaction.value.id}
    						<form:hidden path="transactionDetails[${transaction.key}].id"/>
    					</td>
    					<td align="left" >${transaction.value.traceNumber}
    						<form:hidden path="transactionDetails[${transaction.key}].traceNumber"/>
    					</td>
    					<td align="left" >${transaction.value.providerName}
    						<form:hidden path="transactionDetails[${transaction.key}].providerName"/>
    					</td>
    					<td align="left">${transaction.value.customerSSN}
    						<form:hidden path="transactionDetails[${transaction.key}].customerSSN"/>
    					</td>
    					<td align="left">
    						<form:input path="transactionDetails[${transaction.key}].amount" disabled="true" cssClass="disabled"/>
    						<form:hidden path="transactionDetails[${transaction.key}].amount"/>
   						</td>
    					<td align="left"><form:checkbox path="transactionDetails[${transaction.key}].checked"/></td>
    				</tr>
    			</c:forEach>
    			<tr>
    				<td colspan="5">&nbsp;</td>
    			</tr>
    			<tr>
    				<td colspan="5">
    					Move selected transactions to other provider.<br/>
    					 Provider SSN: <form:input path="toProviderSSN"/><br/>
    					 Provider ID: <form:input path="toProviderID"/><br/>
    				</td>
    			</tr>
    			<tr>
    				<td colspan="5">
    					<input type="submit" name="move_transactions" value="Move to Other Provider"
                        	class='ui-button ui-state-default ui-corner-all'/>
                        &nbsp;
                        <input type="submit" name="process_transactions" value="Process selected transactions"
                                       class='ui-button ui-state-default ui-corner-all'/>
                                        
    				</td>
    			</tr>
    		</table>
    	</form:form>
    </div>
    </c:if>
</div>
</body>